package entity;

import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;

@Entity("cart")
public class Cart {
    @Id
    private ObjectId id;
    private ObjectId userId;
    private String userName;
    private ObjectId productId;
    private String productName;
    private Double price;
    private Integer num;

    public Cart() {
    }

    public Cart(ObjectId id, ObjectId userId, String userName, ObjectId productId, String productName, Double price, Integer num) {
        this.id = id;
        this.userId = userId;
        this.userName = userName;
        this.productId = productId;
        this.productName = productName;
        this.price = price;
        this.num = num;
    }

    public Cart(ObjectId userId, String userName, ObjectId productId, String productName, Double price, Integer num) {
        this.userId = userId;
        this.userName = userName;
        this.productId = productId;
        this.productName = productName;
        this.price = price;
        this.num = num;
    }

    public ObjectId getId() {
        return id;
    }

    public void setId(ObjectId id) {
        this.id = id;
    }

    public ObjectId getUserId() {
        return userId;
    }

    public void setUserId(ObjectId userId) {
        this.userId = userId;
    }

    public ObjectId getProductId() {
        return productId;
    }

    public void setProductId(ObjectId productId) {
        this.productId = productId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    @Override
    public String toString() {
        return "Cart{" +
                "id=" + id +
                ", userId=" + userId +
                ", userName='" + userName + '\'' +
                ", productId=" + productId +
                ", productName='" + productName + '\'' +
                ", price=" + price +
                ", num=" + num +
                '}';
    }
}
